<template>
  <div>
    <button type="primary" @click="firstShow">人脸检测</button>
    <button type="primary" @click="secondShow">疲劳检测</button>
    <button type="primary" @click="closeShow">关闭</button>
    <FaceTrack v-if="firstCom" />
    <FatigueDetection v-if="secondCom" />
  </div>
</template>

<script>
import FaceTrack from "./components/FaceTrack.vue";
import FatigueDetection from "./components/FatigueDetection.vue";
export default {
  name: "App",
  components: {
    FaceTrack,
    FatigueDetection,
  },
  data() {
    return {
      firstCom: false,
      secondCom: false,
    };
  },
  methods: {
    firstShow() {
      this.firstCom = true;
      this.secondCom = false;
    },
    secondShow() {
      this.firstCom = false;
      this.secondCom = true;
    },
    closeShow() {
      this.firstCom = false;
      this.secondCom = false;
    },
  },
};
</script>